/************************************************************************
 * @file StandardMainWindow.h
 * @author Ian Chen
 * @version 1.0
 *
 * @section LICENSE
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 3 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
 * General Public License for more details at
 * http://www.gnu.org/licenses/lgpl.html
 *
 ************************************************************************/
#ifndef STANDARDMAINWINDOW_H
#define STANDARDMAINWINDOW_H

#include <QPixmap>
#include <QMainWindow>
#include <QTranslator>

#include <pluginui/pluginui_global.h>
#include <plugin/plugin/PluginActivator.h>
#include <plugin/util/AbstractSecurityContextHandler.h>
using namespace antu::plugin;

namespace antu
{
namespace plugin
{

class PluginContext;

namespace ui
{
class AbstractExtension;
class ConfigPanelManager;

class PLUGINUISHARED_EXPORT StandardMainWindow : public QMainWindow
{
    Q_OBJECT

private:
    PluginActivator* m_pActivator;
    QTranslator m_oTranslator;

public:
    StandardMainWindow(PluginContext* pContext,
                       AbstractSecurityContextHandler* pHandler = nullptr,
                       const QPixmap& splash = QPixmap());
    ~StandardMainWindow();

    void setApplicationTitle(const QString& title);
    void setVersion(const QString& version);
    void setProductName(const QString& name);
    void setSerialNumber(const QString& serial);
    void setAboutImage(const QPixmap& image);

private:
    QString m_sTitle;
    QString m_sVersion;
    QString m_sProductName;
    QString m_sSerialNumber;
    QPixmap m_oAboutImage;
    PluginContext* m_pContext;
    ConfigPanelManager* m_pConfigPanelManager;

    void initInterface();

protected:
    virtual void closeEvent(QCloseEvent* pEvent);

signals:

private slots:
    void aboutClicked();
    void pluginListClicked();
    void configClicked();
};

}
}
}

#endif // STANDARDMAINWINDOW_H
